// ShThread.cpp : implementation file
//

#include "stdafx.h"
#include "dxd.h"
#include "ShThread.h"


// CShThread

IMPLEMENT_DYNCREATE(CShThread, CWinThread)

CShThread::CShThread()
{
}

CShThread::~CShThread()
{
}

BOOL CShThread::InitInstance()
{
	// TODO:  perform and per-thread initialization here
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	m_dialog=new CMainDialog;
	m_dialog->Create(IDD_DIALOGMAIN,CWnd::FindWindowA("Granado Espada",NULL));
	m_dialog->ShowWindow(SW_NORMAL);
	this->m_pMainWnd=m_dialog;
	return TRUE;
}

int CShThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here
	if(m_pMainWnd!=NULL)
    {
		m_dialog->EndDialog(0);

        delete m_pMainWnd;
        m_pMainWnd = NULL;
    }

	return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(CShThread, CWinThread)
END_MESSAGE_MAP()


// CShThread message handlers
